Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Commit 3ace3289183c36edec03ebb2d29086703ad5665e


Parents : b022631
Author : Mark Qvist <mark@unsigned.io>
Date : 2025-05-11T17:45:49+02:00

Scale interface graphs according to terminal size

Changes

1 files changed, 6 insertions(+), 2 deletions(-)


Diff

diff --git a/nomadnet/ui/textui/Interfaces.py b/nomadnet/ui/textui/Interfaces.py
index 367c682..4134a5f 100644
--- a/nomadnet/ui/textui/Interfaces.py
+++ b/nomadnet/ui/textui/Interfaces.py
@@ -2218,8 +2218,12 @@ class ShowInterface(urwid.WidgetWrap):
self.config_rows = []
- self.history_length=60
- RNS.log(f"Col/rows: {_get_cols_rows()}")
+ screen_cols, _ = _get_cols_rows()
+ margin = 22
+ if screen_cols >= 145:
+ self.history_length = screen_cols//2-margin
+ else:
+ self.history_length = screen_cols-margin
# get interface stats
interface_stats = self.parent.app.rns.get_interface_stats()


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────